<%= simple_form_for([:admin, @user_custom], html: {class: 'layui-form'}) do |f| %>
  <%= f.error_notification %>

    <div class="layui-form-item">
      <%= f.label :phone, class: 'layui-form-label' %>
      <div class="layui-input-block">
        <%= f.input_field :phone, class: 'layui-input', autocomplete: 'off', placeholder: UserCustom.human_attribute_name(:phone) %>
      </div>
    </div>

     <div class="layui-form-item">
      <%= f.label :wechat_img, class: 'layui-form-label' %>
      <div class="layui-input-block">
        <div class="layui-upload-drag" id="test10">
          <i class="layui-icon"></i>
          <p>点击上传</p>
          <div class="<%= @user_custom&.wechat_img&.blank? ? "layui-hide": ""%>" id="uploadDemoView">
            <hr>
            <img src="<%= @user_custom&.wechat_img %>" alt="上传成功后渲染" style="max-width: 196px">
          </div>
        </div>
        <%= f.input_field :wechat_img, class: 'layui-input string', autocomplete: 'off', style: 'display: none;'%>
      </div>
    </div>

  <div class="actions">
    <%= f.submit t('buttons.save'), data: { disable_with: "保存中..." }, class: 'layui-btn' %>
    <%= link_to t('buttons.cancel'), url_for(:back), class: 'layui-btn layui-btn-normal' %>
  </div>
<% end %>

<script>
  uploadIMGLI("#test10")
</script>